<?php
//=======================================
//###################################
// Kayako Web Solutions
//
// Source Copyright 2001-2004 Kayako Infotech Ltd.
// Unauthorized reproduction is not allowed
// License Number: $%LICENSE%$
// $Author: vshoor $ ($Date: 2005/08/07 05:20:29 $)
// $RCSfile: upgrade_step1.php,v $ : $Revision: 1.4 $ 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//###################################
//=======================================


if (!defined("INSWIFT")) {
	// File being called directly, end it
	trigger_error("Unable to process $PHP_SELF", E_USER_ERROR);
}

displayHeader();

displayValue("Product:", SWIFTPRODUCT);
displayValue("File Version:", SWIFTVERSION);
displayValue("Build Date:", BUILDDATE);
displayValue("Build Type:", BUILDTYPE);
displayStatus("Verifying Database Connection", $dbCore->connected, $dbCore->fetchLastError());

if ($dbCore->connected)
{
	require_once ("./setup/steps/global_systemchecks.php");

	if ($_SWIFT["setupfailed"] != true)
	{
		// All Succeeded, Try to authenticate user
		$_version = $dbCore->queryFetch("SELECT * FROM `". TABLE_PREFIX ."settings` WHERE `section` = 'core' AND `vkey` = 'version';");
		displayValue("Current Version:", "<font color='red'>".$_version["data"]."</font>");

		displayField("Username", "username", $_POST["username"], "text");
		displayField("Password", "password", $_POST["password"], "password");


		if ($_SWIFT["errormsg"] == true)
		{
			displayError($_SWIFT["errormsg"]);
		}
	} else {
		$_SWIFT["error"] = true;
	}
} else {
	$_SWIFT["error"] = true;
}

displayFooter();
?>